class Animal {
    String name;
    String color;
    int age;
    public void sleep() {
        System.out.println(name + "在睡大觉");
    }
}
class Dog extends Animal{
    public void bark() {
        System.out.println(name + "正在汪汪汪！！！");
    }
}
class Cat extends Animal {
    public void catchMouse() {
        System.out.println(name + "正在捉老鼠！！！");
    }
}



public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.age = 5;
        dog.color = "黑色";
        dog.name = "旺财";
        dog.bark();
        System.out.println("姓名：" + dog.name + " " + "颜色：" + dog.color + " " + "年龄：" + dog.age);
        dog.sleep();
        Cat cat = new Cat();
        cat.age = 6;
        cat.color = "粉色";
        cat.name = "PerPer";
        cat.catchMouse();
        System.out.println("姓名：" + cat.name + " " + "颜色：" + cat.color + " " + "年龄：" + cat.age);

    }
}
